package shuai.action;

import java.util.List;

import shuai.controller.UserController;
import shuai.model.User;
import shuai.test.Demo;

public class LoginAction extends BaseAction {
	private String username;
	private String userpwd;
	
	public String execute() throws Exception{
		UserController userController=new UserController();
		User user=userController.userLogin(username, userpwd);
		if(user!=null){
			getSession().setAttribute("user", user);
			return SUCCESS;
		}else{
			return ERROR;
		}
	}	
	
	
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getUserpwd() {
		return userpwd;
	}
	public void setUserpwd(String userpwd) {
		this.userpwd = userpwd;
	}
	
	
}	
